<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="/common/commonTag.jsp"%>
<%@include file="/common/commonJS.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<link rel="stylesheet" type="text/css" href="${path}/common/css/charisma-app.css"></link>
	<link rel="stylesheet" type="text/css" href="${path}/common/css/bootstrap-cerulean.css"></link>
</head>
<body>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="row-fluid">
				<div class="span12 center login-header">
					<h2>Welcome to Chase Framework</h2>
				</div>
			</div>
			<div class="row-fluid">
				<div class="well span5 center login-box">
					<div class="alert alert-info">
						Please login with your Username and Password.
					</div>
					<form class="form-horizontal" id="loginForm" method="post" name="loginForm" action="${path}/loginAction!login.action">
						<fieldset>
							<div class="input-prepend" title="Username" data-rel="tooltip">
								<span class="add-on"><i class="icon-user"></i></span>
								<input autofocus class="input-large span10" name="username" id="username" type="text" required="required"/>
							</div>
							<div class="clearfix"></div>
							<div class="input-prepend" title="Password" data-rel="tooltip">
								<span class="add-on"><i class="icon-lock"></i></span>
								<input class="input-large span10" name="password" id="password" type="password" required="required"/>
							</div>
							<div class="clearfix"></div>
							<div class="input-prepend">
								<label class="remember" for="remember"><input type="checkbox" id="remember" name="remember" value="remember-me" /> Remember me</label>
							</div>
							<div class="clearfix"></div>
							<p class="center span5">
								<button type="submit" class="btn btn-primary"><i class="icon-lock"></i> Login</button>
							</p>
						</fieldset>
					</form>
				</div>
			</div>
		</div>
	</div>
</body>
  <script type="text/javascript">
  		$(function(){
  			
			var responseCode = "${responseCode}";
			if(responseCode != ""){
				switch(responseCode){
					case "LOGIN_002" :
						alert('用户名或者密码错误','error');
					break;
					case "LOGIN_003" :
						alert('用户已失效');
					break;
					case "LOGIN_004" :
						alert('验证码错误');
					break;
					default:
						alert('未知错误');
					break;
				}
			}
		});
		
		function clearForm() {
		    $('#loginForm').form('clear');
		}
		
		function submitForm() {
			$('#loginForm').submit();
		}
  </script>
</html>
